package com.ss.android.lockscreen.b;

import android.content.Context;
import android.location.Location;
import android.location.LocationManager;
import android.os.Build;

public final class a {
    private static double a;
    private static double b;
    private static boolean c;

    static {
        a = 40;
        b = 105;
        c = true;
    }

    public static double a(Context arg2) {
        if (!c) {
            c(arg2);
        }

        return a;
    }

    public static double b(Context arg2) {
        if (!c) {
            c(arg2);
        }

        return b;
    }

    private static void c(Context arg4) {
        Location v0_2;
        int v2 = 23;
        Object v0 = arg4.getSystemService("location");
        try {
            if (Build.VERSION.SDK_INT < v2 || arg4.checkSelfPermission("android.permission.ACCESS_FINE_LOCATION") != 0) {
                v0_2 = ((LocationManager) v0).getLastKnownLocation("gps");
                a = v0_2.getLatitude();
                b = v0_2.getLongitude();
                c = true;
                return;
            }

            if (Build.VERSION.SDK_INT >= v2 && arg4.checkSelfPermission("android.permission.ACCESS_COARSE_LOCATION") != 0) {
                return;
            }

            v0_2 = ((LocationManager) v0).getLastKnownLocation("network");
            a = v0_2.getLatitude();
            b = v0_2.getLongitude();
            c = true;
        } catch (Throwable v0_1) {
            v0_1.printStackTrace();
        }
    }
}

